<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <link rel="icon" href="/public/images/favicon.ico" type="image/x-icon">
    <link rel="stylesheet" href="/public/css/min.css">
    <title th:text="${session.lang == 'en' ? menu.titleEn : menu.title}">资料下载</title>
    <meta name="Keywords" content="">
    <meta name="Description" content="">
    <link rel="stylesheet" href="/public/css/style.css" type="text/css" media="all"/>
    <link rel="stylesheet" href="/public/css/pagenavi-css.css" type="text/css" media="all"/>
    <script type="text/javascript" src="/public/js/jquery-1.11.3.min.js"></script>
</head>
<body data-theme-url="" data-device="desktop" class="home page-template page-template-page-templates page-template-page-home page-template-page-templatespage-home-php page page-id-5 language-en">
<div class="loadingBg">
    <div class="loadinglg">
        <div class="ldlogo"></div>
        <div class="ldbg"></div>
    </div>
</div>
<div class="scroller-wrapper" scrollbar>
    <div class="component-transition-line">
        <div class="transition-line__wrapper">
            <div class="transition-line__line">
                <svg class="transition-line__svg" x="0px" y="0px" viewBox="0 0 1920 3105">
                    <path fill="none" stroke-width="4"
                          d="M861.1,1200c120.8-257.7,320.9-290.4,379.8-527.1c30-120.7-0.7-237.2-5.8-255.8 c-35.3-128.4-114.8-193.9-158-232C1036.8,149.8,960.6,82.7,881.7-4.5"/>
                    <path fill="none" stroke-width="4"
                          d="M695,3102c5.5-82.9,49.5-158,86.1-221.6c90.3-157,135.5-235.5,148-265.1c18.3-43.5,91.8-217.8,72-422.5 c-7.1-72.8-39.4-160.8-104-336.9c-70.6-192.2-84.4-195.4-100-265.1c-33.6-149.6-3.1-247.7,64-390.8"/>
                </svg>
            </div>
        </div>
    </div>
    <!--#include file="/views/component/header.html"-->
    <div th:replace="header :: header"></div>
    <main id="barba-wrapper">
        <section class="barba-container" data-namespace="home">
            <div class="misc-sticky || js-scroll js-printed-checker">
                <div class="misc-sticky__wrapper wrapper--left">
                    <div class="component-nav-vertical">
                        <div class="nav-vertical__list"></div>
                        <div class="nav-vertical__arrow">
                            <button class="arrow-line arrow--bottom"><span></span> <span></span></button>
                            <button class="arrow-line arrow--top"><span></span> <span></span></button>
                        </div>
                    </div>
                </div>
            </div>
            <div class="banner">
                <div class="img"><img th:src="${menu.imageUrl}" alt=""></div>
            </div>

            <div class="newsd js-show">
                <div class="container">
                    <div class="pro-download">
                        <table width="100%">
                            <tr>
                                <th><span>文件名称</span></th>
                                <th>发布时间</th>
                                <th>下载</th>
                            </tr>
                            <tr th:each="d: ${dataDowns}">
                                <td><a href="javascript:;" class="fl" th:text="${d.title}">光学样板库</a></td>
                                <td th:text="${#dates.format(d.createtime, 'yyyy-MM-dd')}">2018-11-15</td>
                                <td><a th:href="${d.url}">&nbsp;</a></td>
                            </tr>

                        </table>
                    </div>
                </div>
            </div>
            <!--#include file="/views/component/footer.html"-->
            <div th:replace="footer :: footer"></div>
            <style>
                #cnzz_stat_icon_1280183050 {
                    margin-left: 20px;
                }
            </style>
        </section>
    </main>
</div>
<!--<div class="email-box" id="msgbox">
  <div class="bg"></div>
  <div class="main">
      <div class="close" id="closeid"></div>
      <p>请登陆后再下载！</p>
      <p><input type="text" id="username" placeholder="账号"></p>
      <p><input type="password" id="password" placeholder="密码"></p>
      <a href="javascript:$('#msgbox').hide();" id="msgboxok">确定</a>
  </div>
</div>-->
<div class="login-box" id="login-box">
    <div class="login-bg"></div>
    <div class="login-main">
        <div class="close" onClick="$('#login-box').hide();"></div>
        <div class="intro">
            <h2>用户登录</h2>
            <table width="100%">
                <tr>
                    <td>用户名：</td>
                </tr>
                <tr>
                    <td>
                        <input type="text" id="username">
                        <span class="fi"></span>
                    </td>
                </tr>
                <tr>
                    <td>密 码：</td>
                </tr>
                <tr>
                    <td>
                        <input type="password" id="password">
                        <span class="se"></span>
                    </td>
                </tr>
                <tr>
                    <td>
                        <input type="button" value="登录" class="submit" id="btnlogin">
                    </td>
                </tr>
                <tr>
                    <td>
                        请联系我们索取账号密码
                    </td>
                </tr>
            </table>
        </div>
        <img src="https://yongxin.yxopt.com/cn/images/img28.jpg" width="316" height="437" class="fr" alt="">
    </div>
</div>

<script>
    $('#closeid').click(function () {
        $('#msgbox').hide();
    });
    $('#btnlogin').click(function () {

        //alert(11);

        var username = $('#username').val();

        var password = $('#password').val();

        if (username == '' || password == '') {

            alert('请填写用户名或者密码');
            return;

        }


        $.ajax({

            type: "POST",

            url: "login.php",

            data: {
                'username': username,
                'password': password
            },

            dataType: "json",

            success: function (data) {

                if (data.code == 1) {

                    alert(data.msg);

                    window.location.href = 'download.php';

                } else {

                    alert(data.msg);

                }
            }
        });

    })
</script>
</body>

</html>